package com.itheima.gitweb.demos.controller;



@RestController
public class UserController {

    @Autowired
    UserService userService;

    @PostMapping("/add")
    public Result add(Integer id){
        userService.add(id);
        return Result.success();
    }


    @DeleteMapping("/delete/{ids}")
    public Result delete(List<Integer> ids){
        userService.delete(ids);
        return Result.success();
    }


    @GetMapping("/ queryByid")
    public Result  queryByid(Integer id){
        User user = userService.queryByid(id);
        return Result.success(user);
    }


    @PostMapping("/update")
    public Result update(Integer id){
        userService.update(id);
        return Result.success();
    }

    @PostMapping("/queryList")
    public Result  queryList(User user){
        List<User> user = userService.queryList(user);
        return Result.success(user);
    }


}
